package org.easymis.air.southwest.common.config;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@EnableAutoConfiguration
public class CustomPortController implements EmbeddedServletContainerCustomizer {
	/**
	 * 自定义端口
	 * 
	 * @param container
	 */
	public void customize(ConfigurableEmbeddedServletContainer container) {
		container.setPort(50015);
	}

	@RequestMapping("/")
	public String setPort() {
		return "自定义端口:50015";
	}

	public static void main(String[] args) {
		SpringApplication.run(CustomPortController.class, args);
	}
}
